@extends('layouts.appManager')

@section('content')
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-md-8">

            <div class="card panel">
                <div class="card-header">{{$server->name}}</div>

                <div class="card-body">

                    {{$res}}
                    {{$err}}

                    <hr>

                </div>
            </div>




            <div class="card panel">
                @if (!$err)
                <div class="card-header">游戏服务控制</div>

                <div class="card-body">
                    <form method="POST" action="{{ route('server.command',['server'=>$server->id]) }}">
                        @csrf
                        <div class="text-right">
                            <button type="submit" class="btn btn-warning" name="command" value="server restart 30" >30秒重启服务器</button>
                            <button type="submit" class="btn btn-warning" name="command" value="server restart 300" >5分钟重启服务器</button>
{{--                            <button type="submit" class="btn btn-info" name="command" value="server info" >服务器信息</button>--}}
                            <button type="submit" class="btn btn-info" name="command" value="reload config" >重载配置</button>
                        </div>
                    </form>
                </div>
                @endif
                @if($server->type===2)
                    <div class="card-header">版本更新</div>
                    <div class="card-body">
                        @if($server->version===0)
                            <h4>原版</h4>
                        @elseif($server->version===1)
                            <h4>旧版</h4>
                        @else
                            <h4>NPC机器人版</h4>
                        @endif

                        当前版本：{{$server->getVersion()}}
                        <br>

                        最新版本：{{ config("conf.CoreVer")['S'.$server->type]['C'.$server->version] }}
                        <br><br>
                        @if(config("conf.CoreVer")['S'.$server->type]['C'.$server->version]>$server->getVersion())
                            请打开【管理向导】页面，在【环境安装】中点击【更新】按钮
                        @endif
                    </div>
                @endif
            </div>





        </div>
    </div>
</div>
@endsection
